package org.hhchat.others.aiqiyi;

import java.util.Scanner;

/**
 * Created by hh23485 on 2017/9/10.
 */
public class exam3 {
    public static void main(String[] args){
        Scanner scanner = new Scanner(System.in);
        int n,m;
        n = scanner.nextInt();
        m = scanner.nextInt();

        int count=0;
        for(int i=1;i<=n;i++){
            for(int j=1;j<=m;j++){
                if(isSqltInt(i*j)){
                  count++;
                }
            }
        }
        System.out.println(count);
    }

    public static boolean isSqltInt(long multi){
        return Math.sqrt(multi)%1==0;
    }
}
